package com.situ.mall.controller.front;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.situ.mall.entity.Cart;
import com.situ.mall.entity.OrderItem;
import com.situ.mall.entity.Shipping;
import com.situ.mall.service.ICartService;
import com.situ.mall.service.IShippingService;
import com.situ.mall.service.impl.CartServiceImpl;

@Controller
@RequestMapping("/shipping")
public class FrontShippingController {

	@Autowired
	private IShippingService shippingService;
	
	@Autowired
	private ICartService cartService;
	
	@RequestMapping("/getAddressInfo.shtml")
	public String getAddressInfo(Integer userId, Integer checked, Model model) {
		Shipping shipping = shippingService.getAddressInfo(userId);
		model.addAttribute("shipping", shipping);
		List<Cart>list = cartService.getCartByUserId(userId);
		model.addAttribute("list", list);
		return "order_confirm";
	}
	
	
}
